package demo2;

public class Test {

    public static void main(String[] args) {
        Bear bear = new Bear();
        Square square = new Square();
        Cycle cycle = new Cycle();

        Shape[] shape = {bear, cycle, bear, square, bear};


        //向上转型
        for(Shape s : shape) {
            s.print();//动态绑定 ，多态
        }

    }

}
